$(function (){
    $('#registerButton').on('click',function (){
        console.log('11111')
        var UserName = $('#registerUsername').val();
        var password = $('#registerPassword').val();
        var repeatpassword = $('#registerRepeatedPassword').val();
        $.ajax({
            url:'http://localhost:8080/final_war_exploded/RegisterServlet?registerUsername='+UserName+'&registerPassword='+password+'&registerRepeatedPassword='+repeatpassword,
            type:'POST',
            success : function (data){
                var trimmedData = data.trim().toLowerCase();
                if (trimmedData === 'success'){
                    alert('success');
                } else {
                    $('#labelTip').text(data);
                }
            }
        })
    })
})